package com.example.student1.service.impl;

import com.example.student1.dao.ScoreRepository;
import com.example.student1.domain.Score;
import com.example.student1.domain.Student;
import com.example.student1.service.ScoreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;
import java.util.List;

@Service
@Transactional
public class ScoreImpService implements ScoreService {
    @Autowired
    ScoreRepository scoreRepository;

/*查询所有学生*/
    public List<Score> findAll() {
        return scoreRepository.findAll();
    }

    public List<Score> findBySno(String sno){
        return scoreRepository.findBySno(sno);
    }

    public List<Score> findBySnoAndCno(String sno,String cno){
        return scoreRepository.findBySnoAndCno(sno,cno);
    }

    public Page<Score> findBySname(String sname, Pageable pageable) {
        return scoreRepository.findBySname(sname,pageable);
    }
}
